<?php
	class Model_pay extends CI_Model{
		protected $_table = "tbl_order_cruise";
		protected $_price = "cabinprice";
		public function __construct(){
			parent::__construct();
			$this->load->database();
		}
		public function update_order($data,$id){
			$this->db->where("order_idtrans",$id);
			$this->db->update($this->_table,$data);
		}
		public function update_rooms($cabinid,$pricedate,$night){
			$sql = "UPDATE `cabinprice` SET `numberavai` = `numberavai` - 1 WHERE cabinid = '$cabinid' and numbernight = '$night' and pricedate = '$pricedate'";
			//return $sql;
			$this->db->query($sql);
		}
	}